package com.j.designpattern.adapter;

public class ClassAdapterTest {
    public static void main(String[] args) {
        Adaptee adaptee = new Adaptee();
        Target target = new Adapter(adaptee);
        target.request();

    }

}
/**
 * 目标
 */
interface Target{
    public void request();
}

/**
 * 我是适配者
 */
 class Adaptee {

     public void realRequest() {
        System.out.println("我是适配者哈");
     }
}

/**
 * 我是适配器
 */
class Adapter implements Target {
    Adaptee adaptee;

    public Adapter(Adaptee adaptee) {
        this.adaptee = adaptee;
    }
    @Override
    public void request() {
        adaptee.realRequest();
    }
}